package com.culture.bootdemo.model.req;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * @author: wen
 * @date 2020/10/9
 */
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = {PhoneValidator.class}) // 指定此注解的实现，即:验证器
public @interface PhoneValidatorAnnotation {
    boolean required() default true;

    String message() default "请输入正确的手机格式";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
